// fetching the log
log = context.getLog()

//sample query

//context is a instance of net.sf.xoperator.ui.aiml.TemplateExecutionContext

resultset = context.queryForTable("select distinct ?x, ?ypsilon WHERE {?ypsilon a ?x } LIMIT 10",null,[])

resultset.each(){

	res = it
	log.info(res.getResultCount())
	// res.getResultRows returns a List of Maps. Each map represents a row, with the headline as key.
	res.getResultRows().each(){ 
		log.info("Hohoho: ${it["ypsilon"]} is a ${it["x"]}")
		
	}
	
	
	res.getHeadlines().each{
		log.info("Headline: ${it} contains:");

		res.getResultColumnAsStrings(it).each(){
			log.info(it)
		}
		
		res.getResultColumnAsElements(it).each(){
			log.info("${it.text} is of type ${it.name}")
		}
	}
}

sparqlresult ="select distinct ?x WHERE {?y a ?x } LIMIT 10"




